package com.ruoyi.stu.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ruoyi.stu.domain.StuStudentWord;
import com.ruoyi.system.domain.SysStudentCourse;

/**
 * 学生-单元表
 * 
 * @author Jason
 */
public interface StuStudentWordMapper
{
	
	public List<StuStudentWord> list(
			@Param("studentId")Long studentId,
			@Param("unitId")Long unitId,
			@Param("start")Integer start,
			@Param("limit")Integer limit,
			@Param("orderby")String orderby
			);
	
	/*
	 * 统计学生某个单元的单词总数
	 */
	public Integer count(
			@Param("studentId")Long studentId,
			@Param("unitId")Long unitId,
			@Param("maxWordId")Long maxWordId
			);
	
    /**
     * @return 结果
     */
    public int deleteByStudentId(@Param("studentId")Long studentId);
    
    public int deleteByWordIds(Long[] wordIds);

    /**
     */
    public int countByStudentId(@Param("studentId")Long studentId);

    /**
     */
    public int countByStudentIdAndCourseId(
			@Param("studentId")Long studentId,
			@Param("courseId")Long courseId);

    /**
     * 批量新增
     */
    public int insertBatch(@Param("list")List<SysStudentCourse> list);

    /**
     * 批量新增（通过课程ID）
     * @return 结果
     */
    public int insertBatchByCourseId(
			@Param("studentId")Long studentId,
			@Param("courseId")Long courseId);
    
    /**
     * 删除不在学员-课程内的学员-单词
     */
    public void deleteNotInCourse(@Param("studentId")Long studentId);
}